<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVDriversTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('v_drivers', function (Blueprint $table) {
            $table->increments('id');
            $table->bigInteger('member_id')->default(0)->comment('用户ID');
            $table->uuid('uuid')->comment('唯一标识');
            $table->string('card_no',32)->default('')->comment('身份证号');
            $table->string('pic_card_front',1024)->default('')->comment('身份证正面照片');
            $table->string('pic_card_back',1024)->default('')->comment('身份证反面照片');
            $table->string('pic_driver_license',1024)->default('')->comment('驾驶证');
            $table->string('pic_car_license',1024)->default('')->comment('行驶证');
            $table->string('pic_business_license',1024)->default('')->comment('营业证');
            $table->string('car_no',32)->default('')->comment('车牌号');
            $table->tinyInteger('status')->default(0)->comment('状态，状态 0未认证，10身份认证，20车辆认证');
            $table->tinyInteger('car_status')->default(1)->comment('车辆状态，1空闲，2繁忙');
            $table->timestamps();
            $table->index('member_id', 'idx_memeber_id');
            $table->index('uuid', 'idx_uuid');
            $table->index('status', 'idx_status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('v_drivers');
    }
}
